
export default {
  state: {
    mapType: 'GisView', // 地图显示类型GisView：gis地图，VisView：topo
    fullScreen: false, // 是否是全屏
    stationSelected: [], // 选中显示的站点id
    oldStationSelected: [], // 选中显示的站点id
    filterStationIds: [], // 首页区域/光缆等级筛选选中的
    cableLevelSelected: [ // 选中显示的光缆等级
      'BACKBONE',
      'TRUNK',
      'RELAY',
      'WIRING',
      'FIVE',
      'SIX',
      'SEVEN',
      'EIGHT'
    ],
    gisActived: { // 高亮的站点、光缆
      cableIds: [],
      nodeIds: [],
      color: '',
      mapId: 'gisMap'
    },
    ticktack: 'di', // 只刷新数据改变这个值就能触发
    hideAlarmLevel: [], // 需要隐藏的告警等级
    facilityVisiable: false, // 是否显示地理节点
    layingMethodSelected: [], // 选中显示的敷设方式
    indexShowRight: false, // 右边弹框
    needFitView: false, // 需要自适应地图
    curZoom: null, // 当前地图缩放比例
    isOtdrTesting: false // 判断ot进行中
  },
  mutations: {
    setAlarmLevel(state, data = []) {
      state.hideAlarmLevel = data
    },
    setMapType(state, data) {
      state.mapType = data
    },
    setFullScreen(state, data) {
      state.fullScreen = data
    },
    setStationSelected: (state, data) => (state.stationSelected = data),
    setOldStationSelected: (state, data) => (state.oldStationSelected = data),
    setFilterStationIds: (state, data) => (state.filterStationIds = data),
    setCableLevelSelected: (state, data) => (state.cableLevelSelected = data),
    setGisActived: (state, data) => (state.gisActived = { mapId: 'gisMap', ...data }),
    changeTicktack: (state) => { state.ticktack = state.ticktack === 'di' ? 'da' : 'di' },
    showFacility: (state, data) => { state.facilityVisiable = data },
    setLayingMethod: (state, data) => { state.layingMethodSelected = data },
    setIndexShowRight: (state, data) => { state.indexShowRight = data },
    setNeedFitView: (state, data) => { state.needFitView = data },
    setCurZoomView: (state, data) => { state.curZoom = data },
    setIsOtdrTesting: (state, data) => { state.isOtdrTesting = data }
  },
  actions: {
  },
  getters: {
    mapType: state => state.mapType,
    fullScreen: state => state.fullScreen,
    stationSelected: state => state.stationSelected,
    oldStationSelected: state => state.oldStationSelected,
    cableLevelSelected: state => state.cableLevelSelected,
    gisActived: state => state.gisActived,
    ticktack: state => state.ticktack,
    hideAlarmLevel: state => state.hideAlarmLevel,
    facilityVisiable: state => state.facilityVisiable,
    layingMethodSelected: state => state.layingMethodSelected,
    filterStationIds: state => state.filterStationIds,
    indexShowRight: state => state.indexShowRight,
    needFitView: state => state.needFitView,
    curZoom: state => state.curZoom,
    getIsOtdrTesting: state => state.isOtdrTesting
  }
}
